PWD ?= $(shell pwd)

CC = gcc -std=c99
OPENSSL = $(PWD)/ssl_lib
B64 = $(PWD)/base64.c

update:
	git pull && git submodule init && git submodule update && git submodule status 

test: $(PWD)/src/hq_aes.c $(PWD)/src/test.c $(B64)/base64.c
	$(CC) -g $^ -I src -I $(B64) -I ssl_lib ssl_lib/libcrypto.a ssl_lib/libssl.a -lpthread -ldl -o $(PWD)/Bin/$@
	cp $(PWD)/Bin/$@ $(PWD)/Test_Data/
	cp $(PWD)/Test_Data/bak $(PWD)/Test_Data/cipher

aes: $(PWD)/src/hq_aes.c $(PWD)/src/aes.c $(B64)/base64.c
	$(CC) -g $^ -I src -I $(B64) -I ssl_lib ssl_lib/libcrypto.a ssl_lib/libssl.a -lpthread -ldl -o $(PWD)/Bin/$@
	cp $(PWD)/Bin/$@ $(PWD)/Test_Data/
	cp $(PWD)/Test_Data/bak $(PWD)/Test_Data/cipher
clean:
	rm -rf Bin/* 